package b2.config
{
	public class BattleConfig
	{
		//索引
		public var index:int;
		//战役胜利条件 (0, 全歼敌军; 1, 坚守阵地; 2, 穿越火线; 3, 阻击敌军; 4, 击杀敌首; 5, 保卫主帅; 6, 双方对战) 
		public var goal:int;
		//要塞格子图像
		public var tileImage:String;
		//要塞战斗背景
		public var battleBgr:String;
		//要塞战斗背景颜色滤镜
		public var battleBgrFilter:Array;
		//战役时间
		public var battleTime:int;
		//主基地生命值
		public var baseHp:int;
		//主基地防御砖块索引
		public var baseShell:int;
		//地图
		public var map:String;
		//出生位置（3个出生点位）
		public var birthPlace:Array;
		//战场中同时存在的最多敌人数
		public var enemyExistMax:int;
		//敌人信息
		public var enemyAppears:Array;
		//衡量标准时间(A+, A, A-, B+, B, B-, C+, C, C-)
		public var standardTime:Array;
		//目的地X
		public var destX:int;
		//目的地Y
		public var destY:int;
		
		public function BattleConfig(battleXML:XML)
		{
			index = battleXML.index;
			goal = battleXML.goal;
			tileImage = battleXML.tileImage;
			battleBgr = battleXML.battleBgr;
			if (battleXML.battleBgrFilter != undefined)
				battleBgrFilter = battleXML.battleBgrFilter.split(",");
			battleTime = battleXML.battleTime;
			baseHp = battleXML.baseHp;
			baseShell = battleXML.baseShell;
			map = battleXML.map;
			//3个点位由 ";" 隔开 
			birthPlace = battleXML.birthPlace.split(";");
			enemyExistMax = battleXML.enemyExistMax;
			//敌人信息
			if (battleXML.enemyAppear != undefined)
				enemyAppears = battleXML.enemyAppear.split(";");
			//衡量标准时间(A+, A, A-, B+, B, B-, C, C, C-)
			standardTime = battleXML.standardTime.split(",");
			destX = battleXML.destX;
			destY = battleXML.destY;
		}

	}
}